package com.zhy.service.impl;

import com.zhy.mapper.ArticleMapper;
import com.zhy.mapper.MusicMapper;
import com.zhy.model.Music;
import com.zhy.model.Tag;
import com.zhy.service.MusicService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MusicServiceImpl implements MusicService {
    private Logger logger = LoggerFactory.getLogger(MusicServiceImpl.class);

    @Autowired
    private MusicMapper musicMapper;

    @Override
    public JSONObject findMusics() {
        List<Music> musics=musicMapper.findMusics();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("result", JSONArray.fromObject(musics));
        return jsonObject;
    }
}
